
class CustomWidget(wx.Window):
    """ """

    def __init__(self, parent):
        wx.Window.__init__(self, parent)

        for event, handler in \
            [(wx.EVT_KEY_DOWN, self.on_key_down),
             (wx.EVT_KEY_UP, self.on_key_up),
             (wx.EVT_CHAR, self.on_key_char),
             (wx.EVT_LEFT_DOWN, self.on_mouse_left_down),
             (wx.EVT_LEFT_UP, self.on_mouse_left_up),
             (wx.EVT_MOTION, self.on_mouse_motion),
             (wx.EVT_PAINT, self.on_paint),
             (wx.EVT_SIZE, self.on_resize)]:
            self.Bind(event, handler)

    def on_key_down(self, e):
        e.Skip()

    def on_key_up(self, e):
        e.Skip()

    def on_key_char(self, e):
        e.Skip()

    def on_mouse_left_down(self, e):
        e.Skip()

    def on_mouse_left_up(self, e):
        e.Skip()

    def on_mouse_motion(self, e):
        e.Skip()

    def on_paint(self, e):
        dc = wx.BufferedPaintDC(self)
        dc.Clear()
        dc.DrawRectangle(10, 10, 100, 100)

    def on_resize(self, e):
        pass
